www.gusucode.com > VC++ ICPQ聊天室源程序-源码程序 > VC++ ICPQ聊天室源程序-源码程序/code/ChartRoomClient/MsgInput.cpp

    // MsgInput.cpp : implementation file
// Download by http://www.NewXing.com

#include "stdafx.h"
#include "chartroomclient.h"
#include "ChartRoomDlg.h"
#include "MsgInput.h"
//ChatRoomDlg object point declare
CChartRoomDlg *g_pchatroomdlg = NULL;

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMsgInput

CMsgInput::CMsgInput()
{
}

CMsgInput::~CMsgInput()
{
}


BEGIN_MESSAGE_MAP(CMsgInput, CEdit)
	//{{AFX_MSG_MAP(CMsgInput)
		ON_WM_CHAR()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMsgInput message handlers

void CMsgInput::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
//	char msg[10];
//	wsprintf(msg,"%d:%d",nChar,nFlags);
//	::MessageBox(NULL,msg,"test",MB_OK);
	if (nChar == 10)					//haha,nChar 10 stand for "Ctrl+Enter" key
										//13 stand for "Enter" key			  	
		g_pchatroomdlg->SendDlgItemMessage(IDC_SEND,BM_CLICK,0,0);

	CEdit::OnChar(nChar, nRepCnt, nFlags);
}